<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <meta http-equiv='X-UA-Compatible' content='ie=edge'>
    <title>Document</title>
</head>

<body>
    <div id='app'>
        <com-a></com-a>
        <com-b></com-b>
    </div>
    <script src='../js/vue.js'></script>
    <script>
        // 组件a
        const coma = {
            template: "<div>com-a子组件</div>",
            data() {
                return {};
            },
            methods: {}
        };
        // 组件b
        const comb = {
            template: "<div>com-b子组件</div>"
        }


        const vm = new Vue({
            el: '#app',
            data: {},
            methods: {},
            directives: {},
            filters: {},
            // 局部组件
            components: {
                // 组件名(自定义):组件值(上面定义的对象的变量名)
                // coma: coma, ==>简写成 coma
                // comb: comb  ==>简写成 comb
                // 'con-a':coma
                // 'con-b':comb
                comA: coma,
                comB: comb
            }
        })
    </script>
</body>

</html>